The NGen GUI can load and save files in typical INI format.
"#" is the comment sign. However the INI files containing NGen data must start with the comment "'#NGEN".
There is a global section called "ngen" and one sections for each of the four channels, named "channel0" to "channel3".
Finally, there's a section for the engine speed gradient called "gradient".
Note that you don't need all sections. The only section that always has to exist is the "ngen" section.
If you an INI file doesn't contain a certain section, it is ignored and the according data is not updated.
E.g. if a file only contains "ngen" followed by "gradient" or "channel2", then only this data will be altered.
Also not every entry inside a section has to exist. However, if an entry is missing, a default value is assumed.
E.g. if you want to define an angular signal for a channel and don't care about the PWM parameters, just leave them.
However when loading this INI file, this will also reset the PWM parameters for this channel in case you changed them before.
For specifying periods, offsets etc., one of the following resolution types can be chosen.
Note that INI files saved by the GUI will always use ticks.
Identifier | Description | Short form |
degree | Crankshaft degree (1° == the 360rd part of a crankshaft rotation) | de |
teeth |
Number of crankshaft teeth (one tooth equals 360°/TeethPer360D) |
te |
ticks |
Angular/time ticks. TicksPerTooth angular ticks equal one tooth. Frequency time ticks equal 1s |
ti |
ms | Milliseconds | ms |
us | Microseconds | us |
This section must exist exactly once.
Note that the parameter Frequency is defined for reference and compatibility with future HW solutions. The current hardware supports only exactly 100MHz. So don't change this value.
Furthermore, also the parameters TeethPer360D and TicksPerTooth should not be changed as the current NGen firmware only supports the default values (60 teeth, 256 ticks per tooth).
Parameter | Description | Type | Default |
TeethPer360D |
Number of teeth per crankshaft rotation |
Unsigned integer | 256 |
TicksPerTooth |
Number of angular ticks per crankshaft tooth |
Unsigned integer | 60 |
Frequency |
Number of timer ticks per second in time mode |
Floating point |
100000000 |
ReverseEnable |
Enable reverse rotation (negative engine speeds) |
Boolean ("true", "false") | false |
BiDirEnable |
Enable simulation of bidirectional sensor |
Boolean ("true", "false") | false |
BiDirActiveEdge |
Active edge in bidirectional mode |
Either "falling" or "rising" (only first character counts) |
falling |
BiDirFwdPeriod |
Period in timer ticks after active edge in bidirectional simulation mode (forward direction) |
Unsigned integer | 6000 |
BiDirRevPeriod |
Period in timer ticks after active edge in bidirectional simulation mode (reverse direction) |
Unsigned integer | 9000 |
One section per channel named "channel0" to "channel3". Missing channels are ignored.
The parameter Periods must be specified and has to contain at least one value.
Note that the hardware implementation induces a certain restriction for Mode. Within the channel groups 0,1 and 2,3 it is not possible to use Time and Angle mode and the same time.
E.g. if channel 2 is in time mode, then channel 3 has to be either in time mode or pwm mode, but not in angle mode (and vice versa).
Parameter | Description | Type | Default |
Name |
Channel name displayed in the GUI |
String with up to 16 ASCII characters | - (empty) |
Mode |
Channel mode |
Either "angle", "time" or "pwm" (only 1st character counts) | |
Resolution | The resolution used for the channel data | One of the defined resolution identifiers | degree |
Offset |
Offset of first edge from absolute start position |
Floating Point, as specified by Resolution |
0 |
FirstEdge |
Polarity of first edge |
Either "falling" or "rising" (only first character counts) | falling |
Periods | A comma separated list of periods following the first edge (resulting in alterating edges) |
Floating point, comma separated, using Resolution |
- |
PwmPolarity | Polarity in PWM mode (level during the active phase specified by the duty cycle) | Either "hi" or "lo" (only first character counts) | hi |
PwmDutyCycle | PWM duty cycle in percent (specifies the percentage of active phase per period) |
Floating point, percentage 0..100% |
50 |
PwmFrequency | PWM frequency |
Floating point, Hertz |
1000 |
Optional section. Ignored if missing. The parameters Speeds and Periods must be specified and have to contain at least one value.
The parameter "Resolution" is just there for reference and will be ignored. When files are saved, it will be defined as "ms".
Parameter | Description | Type | Default |
Resolution |
The resolution used for the periods (always milliseconds at the moment) |
One of the defined resolution identifiers |
-ms |
Speeds | A comma separated list of engine speeds in rpm (rotations per minute) |
Signed integer, comma separated, rpm |
- |
Periods | A comma separated list of periods in milliseconds |
Unsigned integer, comma separated, milliseconds |
- |
This should reflect the ROM defaults:
#NGEN [ngen] [channel0] [channel1] [channel2] [channel3] [gradient] |